import React from 'react'
import { useSelector, useDispatch } from "react-redux"
import { ALLSTATE } from "../../../types/store.d"
import { ProductCard, Tag, Button, SubmitBar, Checkbox } from 'react-vant';

function Classify() {
  const dispatch = useDispatch();
  const shopArr = useSelector((state: ALLSTATE) => {
    return state.shopArr
  })
  return (
    <div className="classify">
      {
        shopArr&&shopArr.length>0?shopArr.map((item, index) => {
          return <ProductCard key={index}
            num={item.num}
            price={item.price}
            title={item.title}
            thumb={item.img}
            footer={
              <>
                <Button size="mini" round plain style={{ marginRight: 2 }}>
                  +
                </Button>
                <Button size="mini" round plain>
                  -
                </Button>
              </>
            }
          />
        }):"暂时没有数据"
      }
      <div className="demo-submit-bar">
        <SubmitBar
          price="3050"
          buttonText="提交订单"
        >
          <Checkbox>全选</Checkbox>
        </SubmitBar>
      </div>
    </div>
  )
}

export default Classify